package com.micro.service.client;

import com.micro.service.client.dto.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

// Feign客户端接口
@FeignClient(name = "user-service") // 用户服务的服务名
public interface UserServiceClient {
    // 调用用户服务的接口，根据username查询用户
    @GetMapping("/api/users")
    UserDTO getUserByUsername(@RequestParam("username") String username);
}